<template>
  <div>
    <h2>父组件</h2>
    <p v-show="toy">子组件玩具: {{ toy }}</p>
    <Child @send-toy="getToy"/>
  </div>
</template>

<script lang="ts" setup>
import Child from './child.vue'
import {ref} from 'vue'

let toy = ref('')
function getToy(value: string){
  toy.value = value
}
</script>

<style lang="scss" scoped>
</style>
